import request from "@/utils/request";

// /admin/address/book/page
// 通讯录分页
export const getAddressBookPage = (params) => {
  return request({
    url: "/admin/address/book/page",
    method: "get",
    params,
  });
};

// /admin/address/book/save
// 保存通讯录
export const saveAddressBook = (data) => {
  return request({
    url: "/admin/address/book/save",
    method: "post",
    data,
  });
};

// /admin/address/book/update
// 更新通讯录
export const updateAddressBook = (data) => {
  return request({
    url: "/admin/address/book/update",
    method: "post",
    data,
  });
};

// /admin/address/book/remove
// 删除通讯录
export const removeAddressBook = (data) => {
  return request({
    url: "/admin/address/book/remove",
    method: "post",
    params: data,
  });
};

// /admin/renovation/apply/record/page
// 装修申请
export function getFitmentPage(params) {
  return request({
    url: "/admin/renovation/apply/record/page",
    method: "get",
    params,
  });
}
// /admin/renovation/apply/record/update
// 更新装修申请
export function updateFitmentApplication(data) {
  return request({
    url: "/admin/renovation/apply/record/update",
    method: "post",
    data,
  });
}

// /admin/repair/order/page
// 报修订单
export function getRepairPage(params) {
  return request({
    url: "/admin/repair/order/page",
    method: "get",
    params,
  });
}
// /admin/repair/order/sendOrder
// 派单
export function sendRepairOrder(data) {
  return request({
    url: "/admin/repair/order/sendOrder",
    method: "post",
    data,
  });
}
// /admin/repair/order/finishOrder
// 完成订单
export function finishRepairOrder(data) {
  return request({
    url: "/admin/repair/order/finishOrder",
    method: "post",
    data,
  });
}
// /admin/repair/order/remove
// 删除报修订单
export function removeRepairOrder(data) {
  return request({
    url: "/admin/repair/order/remove",
    method: "post",
    params: data,
  });
}
// /admin/repair/order/repairPage
// 维修订单列表
export function getRepairOrderPage(params) {
  return request({
    url: "/admin/repair/order/repairPage",
    method: "get",
    params,
  });
}
// /admin/borrow/record/page
// 借用记录
export function getBorrowRecordPage(params) {
  return request({
    url: "/admin/borrow/record/page",
    method: "get",
    params,
  });
}

// /admin/borrow/record/update
// 修改借用记录状态
export function updateBorrowRecord(data) {
  return request({
    url: "/admin/borrow/record/update",
    method: "post",
    data,
  });
}

// /admin/mall/category/page
// 商品分类
export function getMallCategoryPage(params) {
  return request({
    url: "/admin/mall/category/page",
    method: "get",
    params,
  });
}
// /admin/mall/category/save
// 保存商品分类
export function saveMallCategory(data) {
  return request({
    url: "/admin/mall/category/save",
    method: "post",
    data,
  });
}
// /admin/mall/category/update
// 更新商品分类
export function updateMallCategory(data) {
  return request({
    url: "/admin/mall/category/update",
    method: "post",
    data,
  });
}

// /admin/mall/category/remove
// 删除商品分类
export function removeMallCategory(id) {
  return request({
    url: "/admin/mall/category/remove",
    method: "post",
    params: { id },
  });
}

// /admin/rent/goods/page
// 租用商品列表
export function getRentGoodsPage(params) {
  return request({
    url: "/admin/rent/goods/page",
    method: "get",
    params,
  });
}

// /admin/rent/goods/save
// 保存租用商品
export function saveRentGoods(data) {
  return request({
    url: "/admin/rent/goods/save",
    method: "post",
    data,
  });
}
// /admin/rent/goods/update
// 更新租用商品
export function updateRentGoods(data) {
  return request({
    url: "/admin/rent/goods/update",
    method: "post",
    data,
  });
}
// /admin/rent/goods/remove
// 删除租用商品
export function removeRentGoods(data) {
  return request({
    url: "/admin/rent/goods/remove",
    method: "post",
    data,
  });
}

// /admin/mall/product/page
// 商品列表
export function getMallProductPage(params) {
  return request({
    url: "/admin/mall/product/page",
    method: "get",
    params,
  });
}
// /admin/mall/product/save
// 保存商品
export function saveMallProduct(data) {
  return request({
    url: "/admin/mall/product/save",
    method: "post",
    data,
  });
}
// /admin/mall/product/update
// 更新商品
export function updateMallProduct(data) {
  return request({
    url: "/admin/mall/product/update",
    method: "post",
    data,
  });
}
// /admin/mall/product/remove
// 删除商品
export function removeMallProduct(id) {
  return request({
    url: "/admin/mall/product/remove",
    method: "post",
    params: { id },
  });
}
